package php.code.indentation;

import static php.Php.PREFERENCES;

public class Indentation {
    public static final String DEFAULT = PREFERENCES.get("next-default", "\t");
    public static final Indentation NONE = new Indentation();
    private Indentation parent;
    private final String tab;

    private Indentation() {
        tab = "";
    }

    public Indentation(Indentation parent, String tab) {
        this.parent = parent;
        this.tab = tab;
    }

    public Indentation(String tab) {
        this.tab = tab;
    }

    @Override
    public String toString() {
        return parent == null ? tab : parent.toString() + tab;
    }
}
